<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="author" content="lijinbo" />
    <meta name="cdnload" content="jquery" />
    <title>053-滚动传播和滚动穿透</title>
    <style>
      #openDialog {
        position: fixed;
        right: 32px;
        bottom: 40px;
        z-index: 10;
      }

      .mask {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 100;
        width: 100%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.4);
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
      }

      .mask .container {
        width: 50%;
        height: 30%;
        overflow-y: scroll;
        background-color: #fff;
        border-radius: 10px;
        box-shadow: 1px 1px 1px #eee;
        box-sizing: border-box;
        padding: 16px;
        margin-bottom: 16px;

        /* 阻止滚动传播 */
        overscroll-behavior: contain;
      }

      /* 阻止滚动穿透 */
      body.static {
        position: fixed;
        left: 0;
        width: 100%;
      }

      /* 滚动条美化 */
      ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
        background-color: transparent;
      }

      ::-webkit-scrollbar-track {
        background-color: transparent;
      }

      ::-webkit-scrollbar-thumb {
        border-radius: 3px;
        background-image: linear-gradient(135deg, #09f, #3c9);
      }
    </style>
  </head>

  <body>
    <button id="openDialog">点击打开弹窗</button>
    <div id="docList"></div>
    <div class="mask" style="display: none">
      <div class="container">
        <ol id="list"></ol>
      </div>
      <div class="container">
        <ol id="list2"></ol>
      </div>
    </div>
    <script type="module" src="./053-main.js"></script>
  </body>
</html>
